#include "stdafx.h"
#include "ClientSocket.h"
#include "SocketException.h"

ClientSocket::ClientSocket(const std::string& host,const int port)
{
	if(!Msocket::Create())
		throw SocketException("Could not create client socket.");
	if(!Msocket::Connet(host,port))
		throw SocketException("Could not connect to server.");
}

ClientSocket::~ClientSocket()
{}

bool ClientSocket::Send(const std::string& message)
{
	return Msocket::Send(static_cast<Msocket&>(*this),message);
}

int ClientSocket::Receive(std::string& message)
{
	return Msocket::Receive(static_cast<Msocket&>(*this),message);
}